package com.pony.test;

import java.io.IOException;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.ObjectWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapred.FileInputFormat;
import org.apache.hadoop.mapred.FileOutputFormat;
import org.apache.hadoop.mapred.JobClient;
import org.apache.hadoop.mapred.JobConf;
import org.apache.hadoop.mapred.TextInputFormat;
import org.apache.hadoop.mapred.TextOutputFormat;

;

public class IndexBuilder {

	@SuppressWarnings("deprecation")
	public static void main(String[] args) throws Exception {
		
		JobConf job = new JobConf(new Configuration(),IndexBuilder.class);
		job.setJobName("IndexBuildTest");
		
		FileInputFormat.setInputPaths(job, new Path("/input"));
		FileOutputFormat.setOutputPath(job, new Path("/output"));
		
		job.setInputFormat(TextInputFormat.class);
		job.setOutputFormat(TextOutputFormat.class);
		
		job.setOutputKeyClass(IntWritable.class);
		job.setOutputValueClass(IntermediateForm.class);
		
		job.setMapperClass(IndexMapper.class);
		job.setReducerClass(IndexReducer.class);
		
		JobClient.runJob(job);
		
	}

}
